from typedef cimport *
from base cimport *
from adapter cimport *

cdef extern from 'stdafx.h':
    ctypedef struct ICtrlVtbl:
        IWindow* ToIWindow(ICtrl* this)

    ctypedef struct ICtrl: # (IObjRef) 'BCB520F9-3C81-4AD7-ADE2-FE72BD761032'
        ICtrlVtbl* lpVtbl

    ctypedef struct IOsrPanelVtbl:
        void SetItemIndex(IOsrPanel* this, LPARAM index)
        LPARAM GetItemIndex(const IOsrPanel* this)
        void SetItemData(IOsrPanel* this, LPARAM dwData)
        LPARAM GetItemData(const IOsrPanel* this)

    ctypedef struct IOsrPanel: # (ICtrl) '36d49c0a-ccba-4238-98e2-b6acb188824b5'
        IOsrPanelVtbl* lpVtbl

    ctypedef struct IItemPanelVtbl:
        void SetSkin(IItemPanel* this, ISkinObj* pSkin)
        void SetColor(IItemPanel* this, COLORREF crBk, COLORREF crSelBk)

    ctypedef struct IItemPanel: # (IOsrPanel) 'F78CA81B-729B-4fe5-B3FE-6C70AD363017'
        IItemPanelVtbl* lpVtbl

    ctypedef struct IImageWndVtbl:
        BOOL SetSkin(IImageWnd* this, ISkinObj* pSkin, int iFrame, BOOL bAutoFree)
        ISkinObj* GetSkin(IImageWnd* this)
        void SetImage(IImageWnd* this, IBitmapS* pBitmap, FilterLevel fl)
        IBitmapS* GetImage(IImageWnd* this)
        BOOL SetIcon(IImageWnd* this, int nSubID)

    ctypedef struct IImageWnd: # (ICtrl) '310a0c73-1dca-4ac2-b6c9-569b0ea40496'
        IImageWndVtbl* lpVtbl

    ctypedef struct IAnimateImgWndVtbl:
        void Start(IAnimateImgWnd* this)
        void Stop(IAnimateImgWnd* this)
        BOOL IsPlaying(const IAnimateImgWnd* this)

    ctypedef struct IAnimateImgWnd: # (ICtrl) 'c2378093-cb34-4811-98d1-a721637b3b87'
        IAnimateImgWndVtbl* lpVtbl

    ctypedef struct IProgressVtbl:
        BOOL SetValue(IProgress* this, int nValue)
        int GetValue(const IProgress* this)
        void SetRange(IProgress* this, int nMin, int nMax)
        void GetRange(const IProgress* this, int*pMin, int*pMax)
        BOOL IsVertical(const IProgress* this)

    ctypedef struct IProgress: # (ICtrl) '0a572106-14e0-48d7-85c3-3e08b9da85a8'
        IProgressVtbl* lpVtbl

    ctypedef struct IIconWndVtbl:
        void SetIcon(IIconWnd* this, HICON hIcon)

    ctypedef struct IIconWnd: # (ICtrl) '80E930E7-BFC2-4e5e-8FFC-A2F0B4EC24E9'
        IIconWndVtbl* lpVtbl

    enum ScrollBarID:
        SSB_NULL = 0
        SSB_HORZ = 1
        SSB_VERT = 2
        SSB_BOTH = (SSB_HORZ | SSB_VERT)

    ctypedef struct IPanelVtbl:
        BOOL ShowScrollBar(IPanel* this, int wBar, BOOL bShow)
        BOOL EnableScrollBar(IPanel* this, int wBar, BOOL bEnable)
        BOOL IsScrollBarEnable(IPanel* this, BOOL bVertical)
        #void SetScrollInfo(IPanel* this, SCROLLINFO si, BOOL bVertical)
        BOOL SetScrollPos(IPanel* this, BOOL bVertical, int nNewPos, BOOL bRedraw)
        int GetScrollPos(IPanel* this, BOOL bVertical)
        BOOL SetScrollRange(IPanel* this, BOOL bVertical, int nMinPos, int nMaxPos, BOOL bRedraw)
        BOOL GetScrollRange(IPanel* this, BOOL bVertical, LPINT lpMinPos, LPINT lpMaxPos)
        BOOL HasScrollBar(IPanel* this, BOOL bVertical)

    ctypedef struct IPanel: # (ICtrl) '8de0a6c5-9cbc-465f-b784-eba4cb8ae6d9'
        IPanelVtbl* lpVtbl

    ctypedef struct IScrollViewVtbl:
        void GetViewSize(const IScrollView* this, LPSIZE pszView)
        void SetViewSize(IScrollView* this, SIZE szView)
        void GetViewOrigin(const IScrollView* this, LPPOINT pptView)
        void SetViewOrigin(IScrollView* this, POINT pt)

    ctypedef struct IScrollView: # (IPanel) 'F7A4A172-31B2-4597-9DE5-F62160723733'
        IScrollViewVtbl* lpVtbl

    enum HeaderMask:
        SHDI_WIDTH = 0x0001
        SHDI_TEXT = 0x0002
        SHDI_FORMAT = 0x0004
        SHDI_LPARAM = 0x0008
        SHDI_ORDER = 0x0010
        SHDI_VISIBLE = 0x0020
        SHDI_WEIGHT = 0x0040
        SHDI_ALL = 0xffff

    ctypedef struct SHDITEM:
        UINT mask
        int cx
        UINT fmt
        UINT state
        int iOrder
        LPTSTR pszText
        int cchMaxText
        LPARAM lParam
        BOOL bDpiAware
        BOOL bVisible
        float fWeight
    ctypedef SHDITEM *LPSHDITEM

    ctypedef struct IHeaderCtrlVtbl:
        int InsertItem(IHeaderCtrl* this, int iItem, LPCTSTR pszText, int nWidth, UINT fmt, LPARAM lParam, BOOL bDpiAware, float fWeight)
        BOOL GetItem(const IHeaderCtrl* this, int iItem, SHDITEM*pItem)
        BOOL SetItem(IHeaderCtrl* this, int iItem, const SHDITEM*pItem)
        UINT GetItemCount(const IHeaderCtrl* this)
        int GetTotalWidth(const IHeaderCtrl* this, BOOL bMinWid)
        BOOL IsAutoResize(const IHeaderCtrl* this)
        int GetItemWidth(const IHeaderCtrl* this, int iItem)
        BOOL DeleteItem(IHeaderCtrl* this, int iItem)
        void DeleteAllItems(IHeaderCtrl* this)
        void SetItemSort(IHeaderCtrl* this, int iItem, UINT sortFlag)
        void SetItemVisible(IHeaderCtrl* this, int iItem, BOOL visible)
        BOOL IsItemVisible(const IHeaderCtrl* this, int iItem)
        int GetOriItemIndex(const IHeaderCtrl* this, int iOrder)
        void GetItemRect(const IHeaderCtrl* this, int iItem, LPRECT prc)

    ctypedef struct IHeaderCtrl: # (ICtrl) 'EE19AA27-7C36-4426-8700-8FBCB0C738F5'
        IHeaderCtrlVtbl* lpVtbl

    ctypedef struct IListViewVtbl:
        BOOL SetAdapter(IListView* this, ILvAdapter* adapter)
        ILvAdapter* GetAdapter(const IListView* this)
        void SetItemLocator(IListView* this, IListViewItemLocator* pItemLocator)
        IListViewItemLocator* GetItemLocator(const IListView* this)
        void EnsureVisible(IListView* this, int iItem)
        void SetSel(IListView* this, int iItem, BOOL bNotify)
        int GetSel(const IListView* this)
        IItemPanel* HitTest(const IListView* this, const POINT*pt)

    ctypedef struct IListView: # (IPanel) '107ED2EA-6C95-4cec-A300-2CE5AB0A7DDB'
        IListViewVtbl* lpVtbl

    ctypedef struct IListViewItemLocatorVtbl:
        void SetAdapter(IListViewItemLocator* this, ILvAdapter* pAdapter)
        void OnDataSetChanged(IListViewItemLocator* this)
        BOOL IsFixHeight(const IListViewItemLocator* this)
        int GetItemHeight(const IListViewItemLocator* this, int iItem)
        void SetItemHeight(IListViewItemLocator* this, int iItem, int nHeight)
        int GetTotalHeight(IListViewItemLocator* this)
        int Item2Position(IListViewItemLocator* this, int iItem)
        int Position2Item(IListViewItemLocator* this, int position)
        int GetScrollLineSize(const IListViewItemLocator* this)
        int GetDividerSize(const IListViewItemLocator* this)
        void SetScale(IListViewItemLocator* this, int nScale)

    ctypedef struct IListViewItemLocator: # (IObjRef)
        IListViewItemLocatorVtbl* lpVtbl

    ctypedef struct IMcListViewVtbl:
        BOOL SetAdapter(IMcListView* this, IMcAdapter* adapter)
        IMcAdapter* GetAdapter(IMcListView* this)
        IListViewItemLocator* GetItemLocator(IMcListView* this)
        void SetItemLocator(IMcListView* this, IListViewItemLocator* pItemLocator)
        void EnsureVisible(IMcListView* this, int iItem)
        void SetSel(IMcListView* this, int iItem, BOOL bNotify)
        int GetSel(IMcListView* this)
        IItemPanel* HitTest(IMcListView* this, const POINT*pt)
        IHeaderCtrl* GetIHeaderCtrl(IMcListView* this)
        int InsertColumn(IMcListView* this, int nIndex, LPCTSTR pszText, int nWidth, UINT fmt, LPARAM lParam, BOOL bDpiAware, float fWeight)
        void DeleteColumn(IMcListView* this, int iCol)
        int GetColumnCount(IMcListView* this)

    ctypedef struct IMcListView: # (IPanel) 'A45F148C-F628-4df7-A60E-B51DA0017B00'
        IMcListViewVtbl* lpVtbl

    ctypedef struct ITreeViewVtbl:
        BOOL SetAdapter(ITreeView* this, ITvAdapter* adapter)
        ITvAdapter* GetAdapter(const ITreeView* this)
        void SetItemLocator(ITreeView* this, ITreeViewItemLocator* pItemLocator)
        ITreeViewItemLocator* GetItemLocator(const ITreeView* this)
        void EnsureVisible(ITreeView* this, HSTREEITEM hItem)
        void SetSel(ITreeView* this, HSTREEITEM hItem, BOOL bNotify)
        HSTREEITEM GetSel(const ITreeView* this)
        IItemPanel* HitTest(const ITreeView* this, const POINT*pt)

    ctypedef struct ITreeView: # (IPanel) '572CA529-AFFF-412c-8A51-2014A9801739'
        ITreeViewVtbl* lpVtbl

    ctypedef struct ITreeViewItemLocatorVtbl:
        void SetAdapter(ITreeViewItemLocator* this, ITvAdapter* pAdapter)
        void OnBranchChanged(ITreeViewItemLocator* this, HSTREEITEM hItem)
        void OnBranchExpandedChanged(ITreeViewItemLocator* this, HSTREEITEM hItem, BOOL bExpandedOld, BOOL bExpandedNew)
        int GetTotalHeight(const ITreeViewItemLocator* this)
        int GetTotalWidth(const ITreeViewItemLocator* this)
        int Item2Position(const ITreeViewItemLocator* this, HSTREEITEM hItem)
        HSTREEITEM Position2Item(const ITreeViewItemLocator* this, int position)
        int GetScrollLineSize(const ITreeViewItemLocator* this)
        void SetItemWidth(ITreeViewItemLocator* this, HSTREEITEM hItem, int nWidth)
        int GetItemWidth(const ITreeViewItemLocator* this, HSTREEITEM hItem)
        void SetItemHeight(ITreeViewItemLocator* this, HSTREEITEM hItem, int nHeight)
        int GetItemHeight(const ITreeViewItemLocator* this, HSTREEITEM hItem)
        int GetItemIndent(const ITreeViewItemLocator* this, HSTREEITEM hItem)

    ctypedef struct ITreeViewItemLocator: # (IObjRef)
        ITreeViewItemLocatorVtbl* lpVtbl

    ctypedef struct ITileViewVtbl:
        BOOL SetAdapter(ITileView* this, ILvAdapter* adapter)
        ILvAdapter* GetAdapter(const ITileView* this)
        void SetItemLocator(ITileView* this, ITileViewItemLocator* pItemLocator)
        ITileViewItemLocator* GetItemLocator(const ITileView* this)
        void EnsureVisible(ITileView* this, int iItem)
        void SetSel(ITileView* this, int iItem, BOOL bNotify)
        int GetSel(const ITileView* this)
        IItemPanel* HitTest(const ITileView* this, const POINT*pt)

    ctypedef struct ITileView: # (IPanel) '5586EA88-3D4B-4d5f-8F71-436D43420D00'
        ITileViewVtbl* lpVtbl

    ctypedef struct ITileViewItemLocatorVtbl:
        void SetAdapter(ITileViewItemLocator* this, ILvAdapter* pAdapter)
        void OnDataSetChanged(ITileViewItemLocator* this)
        int GetItemHeight(const ITileViewItemLocator* this, int iItem)
        void SetItemHeight(ITileViewItemLocator* this, int iItem, int nHeight)
        RECT GetItemRect(ITileViewItemLocator* this, int iItem)
        void SetTileViewWidth(ITileViewItemLocator* this, int width, BOOL bDpiAware)
        void GetItemRowAndColIndex(ITileViewItemLocator* this, int iItem, int*row, int*col)
        BOOL IsLastInRow(ITileViewItemLocator* this, int iItem)
        int GetUpItem(ITileViewItemLocator* this, int iItem)
        int GetDownItem(ITileViewItemLocator* this, int iItem)
        int GetTotalHeight(ITileViewItemLocator* this)
        int Item2Position(ITileViewItemLocator* this, int iItem)
        int Position2Item(ITileViewItemLocator* this, int position)
        int GetScrollLineSize(const ITileViewItemLocator* this)
        int GetMarginSize(const ITileViewItemLocator* this)
        int SetScale(ITileViewItemLocator* this, int scale)
        int GetCountInRow(const ITileViewItemLocator* this)
        int GetItemLineHeight(const ITileViewItemLocator* this)
        int GetItemWidth(const ITileViewItemLocator* this)

    ctypedef struct ITileViewItemLocator: # (IObjRef)
        ITileViewItemLocatorVtbl* lpVtbl

    ctypedef struct IListBoxVtbl:
        int GetCount(const IListBox* this)
        int GetCurSel(const IListBox* this)
        BOOL SetCurSel(IListBox* this, int nIndex, BOOL bNotifyChange)
        int GetTopIndex(const IListBox* this)
        BOOL SetTopIndex(IListBox* this, int nIndex)
        int GetItemHeight(const IListBox* this)
        void SetItemHeight(IListBox* this, int nItemHeight)
        LPARAM GetItemData(const IListBox* this, int nIndex)
        BOOL SetItemData(IListBox* this, int nIndex, LPARAM lParam)
        BOOL GetIText(const IListBox* this, int nIndex, BOOL bRawText, IStringT*str)
        void DeleteAll(IListBox* this)
        BOOL DeleteString(IListBox* this, int nIndex)
        int AddString(IListBox* this, LPCTSTR lpszItem, int nImage, LPARAM lParam)
        int InsertString(IListBox* this, int nIndex, LPCTSTR lpszItem, int nImage, LPARAM lParam)
        void EnsureVisible(IListBox* this, int nIndex)
        int FindString(const IListBox* this, int iFindAfter, LPCTSTR pszText)

    ctypedef struct IListBox: # (IPanel) 'B0B45363-3D10-4889-9459-A2A84E37575F'
        IListBoxVtbl* lpVtbl

    ctypedef struct IComboBaseVtbl:
        int GetCurSel(const IComboBase* this)
        int GetCount(const IComboBase* this)
        BOOL SetCurSel(IComboBase* this, int iSel)
        BOOL GetItemText(const IComboBase* this, int iItem, BOOL bRawText, IStringT*str)
        int FindString(IComboBase* this, LPCTSTR pszFind, int nAfter, BOOL bPartMatch)
        void DropDown(IComboBase* this)
        void CloseUp(IComboBase* this)
        BOOL IsDropdown(const IComboBase* this)
        void SetDropdown(IComboBase* this, BOOL bDropdown)

    ctypedef struct IComboBase: # (ICtrl) '5FB30471-54CB-4db8-9160-31B545E28BC5'
        IComboBaseVtbl* lpVtbl

    ctypedef struct IComboBoxVtbl:
        LPARAM GetItemData(const IComboBox* this, UINT iItem)
        BOOL SetItemData(IComboBox* this, UINT iItem, LPARAM lParam)
        int InsertItem(IComboBox* this, int iPos, LPCTSTR pszText, int iIcon, LPARAM lParam)
        BOOL DeleteString(IComboBox* this, int iPos)
        void ResetContent(IComboBox* this)
        IListBox* GetIListBox(IComboBox* this)

    ctypedef struct IComboBox: # (IComboBase) 'E7F9C5A6-EA49-41c8-9D8F-7075CB9674EA'
        IComboBoxVtbl* lpVtbl

    ctypedef struct IComboViewVtbl:
        IListView* GetIListView(IComboView* this)

    ctypedef struct IComboView: # (IComboBase) '36DD3BAD-523B-421a-9311-3DD0F0BF06D1'
        IComboViewVtbl* lpVtbl

    ctypedef struct IDateTimePickerVtbl:
        void SetTime(IDateTimePicker* this, WORD wYear, WORD wMonth, WORD wDay, WORD wHour, WORD wMinute, WORD wSecond)
        void GetTime(const IDateTimePicker* this, WORD* wYear, WORD* wMonth, WORD* wDay, WORD* wHour, WORD* wMinute, WORD* wSecond)
        void CloseUp(IDateTimePicker* this)
        void DropDown(IDateTimePicker* this)
        void Clear(IDateTimePicker* this)

    ctypedef struct IDateTimePicker: # (ICtrl) '846F25CD-E0DB-49b0-8F20-0BD70538F631'
        IDateTimePickerVtbl* lpVtbl

    ctypedef int(__cdecl *FunTreeSortCallback)(void *pCtx, const void *phItem1, const void *phItem2)

    ctypedef struct ITreeCtrlVtbl:
        HSTREEITEM InsertItem(ITreeCtrl* this, LPCTSTR lpszItem, int nImage, int nSelectedImage, LPARAM lParam, HSTREEITEM hParent, HSTREEITEM hInsertAfter)
        BOOL RemoveItem(ITreeCtrl* this, HSTREEITEM hItem)
        void RemoveAllItems(ITreeCtrl* this)
        HSTREEITEM GetRootItem(const ITreeCtrl* this)
        HSTREEITEM GetNextSiblingItem(const ITreeCtrl* this, HSTREEITEM hItem)
        HSTREEITEM GetPrevSiblingItem(const ITreeCtrl* this, HSTREEITEM hItem)
        HSTREEITEM GetChildItem(const ITreeCtrl* this, HSTREEITEM hItem, BOOL bFirst)
        HSTREEITEM GetParentItem(const ITreeCtrl* this, HSTREEITEM hItem)
        HSTREEITEM GetSelectedItem(const ITreeCtrl* this)
        HSTREEITEM GetNextItem(const ITreeCtrl* this, HSTREEITEM hItem)
        void SortChildren(ITreeCtrl* this, HSTREEITEM hItem, FunTreeSortCallback sortFunc, void*pCtx)
        BOOL SelectItem(ITreeCtrl* this, HSTREEITEM hItem, BOOL bEnsureVisible)
        BOOL GetItemText(const ITreeCtrl* this, HSTREEITEM hItem, IStringT* strText)
        BOOL SetItemText(ITreeCtrl* this, HSTREEITEM hItem, LPCTSTR lpszItem)
        BOOL GetItemImage(const ITreeCtrl* this, HSTREEITEM hItem, int*nImage, int*nSelectedImage)
        BOOL SetItemImage(ITreeCtrl* this, HSTREEITEM hItem, int nImage, int nSelectedImage)
        LPARAM GetItemData(const ITreeCtrl* this, HSTREEITEM hItem)
        BOOL SetItemData(ITreeCtrl* this, HSTREEITEM hItem, LPARAM lParam)
        BOOL ItemHasChildren(const ITreeCtrl* this, HSTREEITEM hItem)
        int GetCheckState(const ITreeCtrl* this, HSTREEITEM hItem)
        BOOL SetCheckState(ITreeCtrl* this, HSTREEITEM hItem, BOOL bCheck)
        BOOL Expand(ITreeCtrl* this, HSTREEITEM hItem, UINT nCode)
        BOOL EnsureVisible(ITreeCtrl* this, HSTREEITEM hItem)

    ctypedef struct ITreeCtrl: # (ICtrl) 'A877B61C-7E5E-4716-8423-8DC61EAF61E9'
        ITreeCtrlVtbl* lpVtbl

    ctypedef struct IHotKeyCtrlVtbl:
        void SetRule(IHotKeyCtrl* this, WORD wInvalidComp, WORD wModifier)
        void SetHotKey(IHotKeyCtrl* this, WORD wKey, WORD wModifiers)
        void GetHotKey(const IHotKeyCtrl* this, WORD* wKey, WORD* wModifers)

    ctypedef struct IHotKeyCtrl: # (ICtrl) 'E21767AC-6A40-45a2-9E5C-EA5CDF516C60'
        IHotKeyCtrlVtbl* lpVtbl

    ctypedef struct IRichEditVtbl:
        DWORD SaveRtf(IRichEdit* this, LPCTSTR pszFileName)
        DWORD LoadRtf(IRichEdit* this, LPCTSTR pszFileName)
        void SetSel(IRichEdit* this, long nStartChar, long nEndChar, BOOL bNoScroll)
        void ReplaceSel(IRichEdit* this, LPCTSTR pszText, BOOL bCanUndo)
        BOOL GetWordWrap(const IRichEdit* this)
        void SetWordWrap(IRichEdit* this, BOOL fWordWrap)
        BOOL GetReadOnly(const IRichEdit* this)
        BOOL SetReadOnly(IRichEdit* this, BOOL bReadOnly)
        LONG GetLimitText(const IRichEdit* this)
        BOOL SetLimitText(IRichEdit* this, int nLength)
        WORD GetDefaultAlign(const IRichEdit* this)
        void SetDefaultAlign(IRichEdit* this, WORD wNewAlign)
        BOOL GetRichTextFlag(const IRichEdit* this)
        void SetRichTextFlag(IRichEdit* this, BOOL fRich)
        LONG GetDefaultLeftIndent(const IRichEdit* this)
        void SetDefaultLeftIndent(IRichEdit* this, LONG lNewIndent)
        BOOL SetSaveSelection(IRichEdit* this, BOOL fSaveSelection)
        COLORREF SetDefaultTextColor(IRichEdit* this, COLORREF cr)

    ctypedef struct IRichEdit: # (ICtrl) '7B9C2C3E-3101-4cda-9436-F88D9993BA5F'
        IRichEditVtbl* lpVtbl

    ctypedef struct ITabPageVtbl:
        LPCTSTR GetTitle(const ITabPage* this)
        void SetTitle(ITabPage* this, LPCTSTR lpszTitle)
        int GetIconIndex(const ITabPage* this)
        void SetIconIndex(ITabPage* this, int iIcon)

    ctypedef struct ITabPage: # (ICtrl) 'A32ED365-E6B8-4ada-BE49-BCF127F94427'
        ITabPageVtbl* lpVtbl

    ctypedef struct ITabCtrlVtbl:
        int GetCurSel(const ITabCtrl* this)
        BOOL SetCurSel(ITabCtrl* this, int nIndex)
        BOOL SetItemTitle(ITabCtrl* this, int nIndex, LPCTSTR lpszTitle)
        int InsertItem(ITabCtrl* this, LPCWSTR lpContent, int iInsert)
        int GetItemCount(const ITabCtrl* this)
        ITabPage* GetPage(ITabCtrl* this, int nIndex)
        BOOL RemoveItem(ITabCtrl* this, int nIndex, int iSelPage)
        void RemoveAllItems(ITabCtrl* this)
        int GetPageIndex(ITabCtrl* this, LPCTSTR pszName, BOOL bTitle)

    ctypedef struct ITabCtrl: # (ICtrl) '17714866-88B9-480b-83D1-F044486D78D1'
        ITabCtrlVtbl* lpVtbl

    ctypedef struct ISpinButtonCtrlVtbl:
        void SetValue(ISpinButtonCtrl* this, int nValue)
        void SetRange(ISpinButtonCtrl* this, int nMin, int nMax)
        void SetStep(ISpinButtonCtrl* this, UINT nStep)
        int GetValue(const ISpinButtonCtrl* this)
        IWindow* GetIBuddy(const ISpinButtonCtrl* this)

    ctypedef struct ISpinButtonCtrl: # (ICtrl) '7F8DF81C-6C6E-4572-BDE6-0757A4D07C5F'
        ISpinButtonCtrlVtbl* lpVtbl
